<?php
if (empty($_toolbars)) {
    return;
}
extract($_toolbars);
$this->assign('title', $title);
?>
<div id="toolbar" class="clearfix">
    <div id="toolbar-control" class="control-icon">
    <p class="txtleft">
        <?php

        foreach ($options as $class => $text) {
            $action = $class;
            if (is_array($text)) {
                $action = $text['action'];
                $text = $text['text'];
            }
            $css = null ;
            $tagi= null;
            switch ($action) {
                case 'add':
                    $css = 'btn btnitem';
                    $tagi ='<i class="icon-plus">&nbsp;</i>';
                    break;
                case 'save':
                    $css=  "btn btn-primary";
                    $tagi ='<i class="icon-save">&nbsp;</i>';
                    break;
                case 'edit':
                    $css ="btn btn-primary";
                    $tagi ='<i class="icon-save">&nbsp;</i>';
                    break;
                case 'removes':
                    $css= "btn btn-warning";
                    $tagi ='<i class="icon-is-remove">&nbsp;</i>';
                    break;  
                case 'remove':
                    $css= "btn btn-warning";
                    $tagi ='<i class="icon-is-remove">&nbsp;</i>';
                    break; 
                case 'cancel':
                    $css= "btn  btn-danger";
                    $tagi ='<i class="icon-remove icon-white">&nbsp;</i>';
                    break;                               
            }
            echo $this->Html->tag('button', $tagi.$text, array('rel' => $action,'class'=>$css,'title' => $class));
        }
        ?>
        </p>
    </div>
</div>